      FUNCTION FSEDMODE(WS,USTOT,USGRN,RSNDM,ISNDM1,ISNDM2,IMODE)
      INTEGER::ISNDM2,ISNDM1,IMODE
      REAL::FSEDMODE,US,USTOT,USGRN,USDWS,WS,RSNDM,TMPVAL
C **  FSEDMODE SETS BEDLOAD (IMODE=1) AND SUSPENDED LOAD (IMODE=2)
C **  TRANSPORT FRACTIONS
C
      
C
C     CHOOSE BETWEEEN TOTAL STRESS SHEAR VELOCITY AND GRAIN STRESS 
C     SHEAR VELOCITY
C
      IF(ISNDM2.EQ.0)THEN
	  US=USTOT
	ELSE
	  US=USGRN
	ENDIF
C
      USDWS=US/WS
C
C     CHOOSE BETWEEN MODE OPTIONS
C
C     ISNDM1=0 SET BOTH BEDLOAD AND SUSPENDED LOAD FRACTIONS TO 1.0
C     
      IF(ISNDM1.EQ.0) FSEDMODE=1.0
C
C     ISNDM1=1 SET BEDLOAD FRACTION TO 1. USE BINARY RELATIONSHIP FOR SUSPENDED
C
      IF(ISNDM1.EQ.1)THEN
	  FSEDMODE=0.
        IF(IMODE.EQ.1)THEN
          FSEDMODE=1.0
        ELSE
          IF(USDWS.GE.RSNDM)FSEDMODE=1.
        END IF
      END IF
C
C     ISNDM1=2 SET BEDLOAD FRACTION TO 1, USE LINEAR RELATIONSHIP FOR SUSPENDED
C
      IF(ISNDM1.EQ.2)THEN
        IF(IMODE.EQ.1)THEN
          FSEDMODE=1.0
        ELSE
          TMPVAL=((USDWS)-0.4)/9.6
          TMPVAL=MIN(TMPVAL,1.0)
          TMPVAL=MAX(TMPVAL,0.0)
	    FSEDMODE=TMPVAL
        END IF
      END IF
C
C     ISNDM1=3 USE BINARY RELATIONSHIP FOR BEDLOAD AND SUSPENDED LOAD
C
      IF(ISNDM1.EQ.3)THEN
	  FSEDMODE=0.
        IF(IMODE.EQ.1)THEN
          IF(USDWS.LT.RSNDM)FSEDMODE=1.
        ELSE
          IF(USDWS.GE.RSNDM)FSEDMODE=1.
        END IF
      END IF
C
C     ISNDM1=4 USE LINEAR RELATIONSHIP FOR BEDLOAD AND SUSPENDED LOAD
C
      IF(ISNDM1.EQ.4)THEN
        TMPVAL=((USDWS)-0.4)/9.6
        TMPVAL=MIN(TMPVAL,1.0)
        TMPVAL=MAX(TMPVAL,0.0)
        IF(IMODE.EQ.1)THEN
          FSEDMODE=1.-TMPVAL
        ELSE
          FSEDMODE=TMPVAL
        END IF
      END IF
C
      RETURN
      END
